package com.example.pattern.proxy;

import org.springframework.cglib.proxy.Proxy;

/**
 * FM_南风
 *
 * @author fengmingming
 * @date 2024/6/25 13:39
 */
public class ProxyInvocationClient {
    public static void main(String[] args) {
        RealSubject realSubject = new RealSubject();
        Subject proxy = (Subject) Proxy.newProxyInstance(
                realSubject.getClass().getClassLoader(),
                realSubject.getClass().getInterfaces(),
                new ProxyInvocationHandler(realSubject)
        );

        proxy.request();
    }
}
